package com.atstudy.st;

/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2023/1/13 13:38
 * @copyright: 博为峰
 */
public class St07 {

    //volatile 防止重排序，增加可见性
    private volatile static St07 st02;

    private St07() {
    }

    //t0 t1  St04.class 字节码文件对象
    public static St07 getSt() {
        //Double Check Lock  (DCL)
        if (st02 == null) {
            synchronized (St07.class) {
                if (st02 == null) {
                    //t0  t1
                    st02 = new St07();
                }
            }
        }
        return st02;
    }
}
